import pyglet
from pyglet.window import key
from config import *


class Ground(pyglet.sprite.Sprite):

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.x0 = self.x
        self.dy = 0

    def update(self, t):
        t = t * 60
        self.dy = self.dy + t * speed
        if self.dy > 37:
            self.dy = self.dy - 38
        self.x = self.x0 - self.dy
